Skip to content

Set updated_by field to null #6556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

akatsoulas
Copy link
Collaborator

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The purpose of this PR is to update the deletion behavior of the updated_by field on posts, ensuring that when a user is deleted, the related post retains data by setting updated_by to null instead of cascading the deletion.

  • Updated the migration file to alter the updated_by field with on_delete=SET_NULL.
  • Changed the field definition in the models file from on_delete=models.CASCADE to on_delete=models.SET_NULL.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
kitsune/forums/migrations/0005_alter_post_updated_by.py Generated migration updating the on_delete behavior for updated_by
kitsune/forums/models.py Updated the updated_by field to use SET_NULL on delete

@akatsoulas akatsoulas merged commit 547d96d into mozilla:main Mar 13, 2025
2 checks passed
@akatsoulas akatsoulas deleted the delete-content-forums branch March 13, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants